﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Role : MonoBehaviour
{
    OperationInfo operationInfo;
    bool isOperation;
    void Start()
    {
        
    }

    public void SetOperation(OperationInfo _operationInfo)
    {
        operationInfo = _operationInfo;
    }
    private void Update()
    {
        OperationExecute();
    }
    public void OperationExecute()
    {
        if (operationInfo != null)
        {
            transform.localEulerAngles = new Vector3(0, operationInfo.angle, 0);
            if (operationInfo.isClickW)
            {
                transform.Translate(transform.forward * Time.deltaTime * 0.1F);
            }
            if (operationInfo.isClickS)
            {
                transform.Translate(transform.forward * Time.deltaTime * -0.1F);
            }
            if (operationInfo.isClickA)
            {
                transform.Translate(transform.right * Time.deltaTime * -0.1F);
            }
            if (operationInfo.isClickD)
            {
                transform.Translate(transform.right * Time.deltaTime * 0.1F);
            }
        }
        
    }
}
